check how many times a character appears in a string java

114

check how many times a character appears in a string java -

str.chars().filter(num -> num == '$').count()

Comments

Submit
0 Comments